package com.hecn.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author 陈朋康
 * @site hecn.gitee.io
 * @discription
 */
@Controller
public class RestFulController {
    @RequestMapping("/commit/{p1}/{p2}")
    public String index(@PathVariable int p1, @PathVariable String p2, Model model){
        String result=p1+p2;
        model.addAttribute("msg","结果"+result);
        return "test";
    }

    @RequestMapping(value = "/hello",method = {RequestMethod.GET})
    public String index2( Model model){
        model.addAttribute("msg","hello");
        return "test";
    }
}
